package net.itgoo.parkingpay.rest.model;

import org.json.JSONObject;

public class ParkingMerchantModel {
    public long id;
    public String plate;
    public String company;
    public String term;
    public String cardType;
    public int cardTypeId;

    public static ParkingMerchantModel parse(JSONObject jsonObject) {
        ParkingMerchantModel parkModel = new ParkingMerchantModel();
        if (jsonObject != null) {
            try {
                parkModel.id = jsonObject.getLong("id");
                parkModel.plate = jsonObject.getString("plateno");
                parkModel.company = jsonObject.getString("company");
                parkModel.term = jsonObject.getString("term");
                parkModel.cardType = jsonObject.getString("cardtype");
                parkModel.cardTypeId = jsonObject.getInt("cardtypeid");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return parkModel;
    }
}
